package com.jrx.anytxn.feign.gateway.bean;

import java.io.Serializable;

/**
 * @program: anytxn-cf-feign
 * @description: 通用接口返回
 * @author: xiaoyu.jing
 * @date: 2019-11-25 10:03
 **/
public class ApiResponse<T> implements Serializable {
    private  int code;
    private  String message;
    private  Long startTime;
    private  Long endTime;
    private  T data = null;

    public ApiResponse(){}

    public ApiResponse(int code, String message, Long startTime, Long endTime, T data) {
        this.code = code;
        this.message = message;
        this.startTime = startTime;
        this.endTime = endTime;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ApiResponse{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", data=" + data +
                '}';
    }

}
